package com.xbongbong.pro.weblist.pojo.dto;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.domain.entity.ext.ConditionsEntityExt;
import com.xbongbong.paas.pojo.ExcelPartialExportPojo;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.paas.toolbox.wrap.QueryIgnore;
import java.util.List;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

/**
 * @author haibin.zhang
 * @version v1.0
 * @date 2019/3/21 15:24
 * @since v1.0
 */
@Getter
@Setter
public class NearCustomerDTO extends BaseDTO {
    /**
     * 应用id
     */
    @NotNull(message = "{dto.msg.nearCustomer.appId.NotNull}")
    private Long appId;


    /**
     * 分页当前页
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer page;

    /**
     * 分页每页记录数
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer pageSize;

    /**
     * 分组id
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Long listGroupId;

    /**
     * 是否默认分组
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer defaultGroup;

    /**
     * saas业务类型
     */
    @Getter(onMethod_ = {@QueryIgnore})
    @NotNull(message = "{dto.msg.nearCustomer.businessType.NotNull}")
    private Integer businessType;
    /**
     * saas子业务类型
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer subBusinessType;
    /**
     * 移动端特殊筛选
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private JSONArray mobileSpecialFilter;
    /**
     * 部分导出
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private ExcelPartialExportPojo excelPartialExportPojo;
    /**
     * 是否是部分导出,1为部分导出
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer partialExport;
    /**
     * 表单id
     */
    private Long formId;
    /**
     * 距离范围
     */
    private String distance;
    /**
     * 是否新建签到 1是新建
     */
    private Integer isNewSignIn;

    /**
     * 距离范围m
     */
    private Integer distancePower;
    /**
     * 客户状态
     */
    private String type;
    /**
     * 经度
     */
    private Double longitude;
    /**
     * 纬度
     */
    private Double latitude;
    /**
     * 最近跟进时间
     */
    @Size(max = 2,message = "{dto.msg.nearCustomer.lastConnectTime.Size}")
    private JSONArray lastConnectTime;
    /**
     * 公海
     */
    private Integer isPublic;
    /**
     * 归档
     */
    private Integer isArchived;
    /**
     * 名称模糊
     */
    private String nameLike;
    /**
     * 范围筛选
     */
    private JSONObject rangeScreen;
    /**
     * 搜索条件
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private List<ConditionsEntityExt> conditions;

    public void setIsPublic(Integer isPublic) {
        this.isPublic = isPublic == null ? 0 : isPublic;
    }

    public NearCustomerDTO() {
        this.isPublic = 0;
    }
}
